#ifndef __THREADPOOL_HPP__
#define __THREADPOOL_HPP__
#include "TaskQue.hpp"
#include <vector>
#include <thread>

namespace wd
{
using std::vector;
using std::thread;


class ThreadPool
{
public:
    ThreadPool(int,size_t);

    void start();
    void stop();

    void addTask(TaskPtr); 
private:
    void doTask();
private:
    int _threadNum;
    size_t _taskCapacity;
    vector<thread> _threadPool;
    TaskQue _taskque;

    bool _isRunning; 
};

}//end of namespace wd


#endif // __THREADPOOL_HPP__

